package com.albaba.designpattern.visitor.text_001;

import java.time.LocalDate;

/**
 * @Description: 糖果类
 * @Author zx
 * @Date 2025/2/25 18:15
 * @Version 1.0
 */
public class Candy extends Product implements Acceptable {

    public Candy(String name, LocalDate produceDate, double price) {
        super(name, produceDate, price);
    }

    @Override
    public void accept(Visitor visitor) {
        // 在accept方法中调用访问者，并将自己 this 传递回去
        visitor.visit(this);
    }
}
